home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8953 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: news.IT.net!news
  2. From: gema001@pn.itnet.it (Antonio Romeo)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: need help with functions
  5. Date: 27 Feb 1996 16:27:02 GMT
  6. Organization: CyberPress
  7. Message-ID: <4gvbcm$4p2@alpha.it.net>
  8. References: <4grqta$mcb@ixnews3.ix.netcom.com>
  9. NNTP-Posting-Host: gema001.pn.itnet.it
  10. Mime-Version: 1.0
  11. Content-Type: Text/Plain; charset=US-ASCII
  12. X-Newsreader: WinVN 0.99.7
  13.  
  14. In article <4grqta$mcb@ixnews3.ix.netcom.com>, wells2@ix.netcom.com says...
  15. >
  16. >
  17. >
  18. >  I am learning c++, I wrote this program and I have a problem with it
  19. >that i cant figure out. I am doin this for my class in college. I am
  20.  
  21. >says something like.... "Get_payment is not suffieciently different
  22.  
  23. unction Prototype    
  24. >
  25. >void Get_Payment(float,float,int,float);          // Function prototype
  26. >                 
  27. >    
  28. >void Get_Payment(float &loan_amount,float &interest_rate,int
  29. >    &number_of_payments, float &payment) 
  30. >                        
  31. >        {
  32. >             ...
  33. >        return;
  34. >        }
  35.  
  36.  
  37. I think the problem is in the difference between the prototipe
  38. and the implementation of the function:
  39.     float   and  float & 
  40. just aren't the same type. If you want to pass the variable reference
  41. in function (and not jst its value) you must use a prototype as:
  42.  
  43. void Get_Payment(float &, float &, int &, float &);
  44.  
  45. Antonio Romeo - Rome - Italy
  46. gema001@pn.itnet.it
  47.  
  48.  
  49.  
  50.